package cn.edu.hust.sse.software7.class3.common;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateTools {
	static DateFormat df = new SimpleDateFormat("yyyy-MM-dd");

	public static Date getDate(String strDate) {
		Date date = null;
		try {
			date = df.parse(strDate);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return date;
	}

	public static String getString(Date date) {

		return df.format(date);
	}

}
